package cn.jtfadmin.activiti.domain.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 流程实例dto
 * @author jtf
 * @since 0.0.1
 */
@Data
public class HistoryProcessInstanceDetailDTO implements Serializable {

    /**
     * 流程实例
     */
    protected HistoryProcessInstanceDTO processInstanceDTO;

    /**
     * 启动表单
     */
    protected FormDTO startFormDTO;

    /**
     * 任务信息
     */
    protected List<TaskDTO> taskDTOList;


    @Data
    public static class  TaskDTO implements Serializable{

        /**
         * 删除原因
         */
        protected String deleteReason;

        /**
         * 开始时间
         */
        protected Date startTime;

        /**
         * 结束时间
         */
        protected Date endTime;

        /**
         * 任务时长
         */
        protected Long durationInMillis;

        /**
         * 完成时长
         */
        protected Long workTimeInMillis;

        /**
         * 领取时间
         */
        protected Date claimTime;

        /**
         * 任务id
         */
        protected String id;

        /**
         * 任务名称
         */
        protected String name;

        /**
         * 任务描述
         */
        protected String description;

        /**
         * 重要级别
         */
        protected int priority;

        /**
         * 任务拥有人id
         */
        protected String owner;

        /**
         * 领取人
         */
        protected String assignee;

        /**
         * 流程实例id
         */
        protected String processInstanceId;

        /**
         * 执行路径id
         */
        protected String executionId;

        /**
         * 流程定义id
         */
        protected String processDefinitionId;

        /**
         * 创建时间
         */
        protected Date createTime;

        /**
         * 任务定义key
         */
        protected String taskDefinitionKey;

        /**
         * 到期时间
         */
        protected Date dueDate;

        /**
         * 任务类别
         */
        protected String category;

        /**
         * 上级任务id
         */
        protected String parentTaskId;

        /**
         * 租户id
         */
        protected String tenantId;

        /**
         * 表单key
         */
        protected String formKey;

        /**
         * 任务本地变量
         */
        protected Map<String, Object> taskLocalVariables;

        /**
         * 流程变量
         */
        protected Map<String, Object> processVariables;

        /**
         * 表单信息
         */
        protected FormDTO formDTO;

        public TaskDTO() {
        }

        public TaskDTO(String deleteReason, Date startTime, Date endTime, Long durationInMillis, Long workTimeInMillis, Date claimTime, String id, String name, String description, int priority, String owner, String assignee, String processInstanceId, String executionId, String processDefinitionId, Date createTime, String taskDefinitionKey, Date dueDate, String category, String parentTaskId, String tenantId, String formKey, Map<String, Object> taskLocalVariables, Map<String, Object> processVariables, FormDTO formDTO) {



            this.deleteReason = deleteReason;
            this.startTime = startTime;
            this.endTime = endTime;
            this.durationInMillis = durationInMillis;
            this.workTimeInMillis = workTimeInMillis;
            this.claimTime = claimTime;
            this.id = id;
            this.name = name;
            this.description = description;
            this.priority = priority;
            this.owner = owner;
            this.assignee = assignee;
            this.processInstanceId = processInstanceId;
            this.executionId = executionId;
            this.processDefinitionId = processDefinitionId;
            this.createTime = createTime;
            this.taskDefinitionKey = taskDefinitionKey;
            this.dueDate = dueDate;
            this.category = category;
            this.parentTaskId = parentTaskId;
            this.tenantId = tenantId;
            this.formKey = formKey;
            this.taskLocalVariables = taskLocalVariables;
            this.processVariables = processVariables;
            this.formDTO = formDTO;
        }
    }

}
